package com.zhhh.domain;
// Generated 2019-10-11 15:23:22 by Hibernate Tools 3.4.0.CR1

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * BModeOper generated by hbm2java
 */
@Entity
@Table(name = "b_mode_oper")
public class BModeOper implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private String ctrlCode;
	private String operId;
	private String operText;
	private String operEvent;
	
	private BModeControl modeControl;
	
	private BRoleModeOper roleModeOper;

	public BModeOper() {
	}

	public BModeOper(String ctrlCode, String operId, String operText, String operEvent) {
		this.ctrlCode = ctrlCode;
		this.operId = operId;
		this.operText = operText;
		this.operEvent = operEvent;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
//,insertable=false,updatable=false
	@Column(name = "ctrl_code")
	public String getCtrlCode() {
		return this.ctrlCode;
	}

	public void setCtrlCode(String ctrlCode) {
		this.ctrlCode = ctrlCode;
	}

	@Column(name = "oper_id", length = 40)
	public String getOperId() {
		return this.operId;
	}

	public void setOperId(String operId) {
		this.operId = operId;
	}

	@Column(name = "oper_text", length = 40)
	public String getOperText() {
		return this.operText;
	}

	public void setOperText(String operText) {
		this.operText = operText;
	}

	@Column(name = "oper_event", length = 40)
	public String getOperEvent() {
		return this.operEvent;
	}

	public void setOperEvent(String operEvent) {
		this.operEvent = operEvent;
	}


	@ManyToOne
	@org.hibernate.annotations.ForeignKey(name="none")
	@JoinColumn(name="ctrl_code", referencedColumnName="ctrl_id",insertable=false,updatable=false)
//	@ManyToOne(fetch = FetchType.LAZY)
//	@JoinColumn(name = "ctrl_code")
	@JsonIgnore
	public BModeControl getModeControl() {
		return modeControl;
	}

	public void setModeControl(BModeControl modeControl) {
		this.modeControl = modeControl;
	}
	
	
	/**
	 * @Transient注解： 该属性不需要与数据库映射
	 */
	@Transient
	public BRoleModeOper getRoleModeOper() {
		return roleModeOper;
	}

	public void setRoleModeOper(BRoleModeOper roleModeOper) {
		this.roleModeOper = roleModeOper;
	}

}
